<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php echo $html->charset(); ?>
<title><?php __('cBBweb:'); ?> <?php echo $title_for_layout; ?></title>
<?php
echo $html->meta('icon');
echo $html->css('cake.generic');
echo $html->css('tables');
echo $html->css('menu_style');
echo $scripts_for_layout;
?>
</head>
<body>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '<?php echo $ganalytics?>']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
<?php
echo $javascript->link('prototype');
echo $javascript->link('scriptaculous');
?>
<div id="container">
<div id="header">
<h1><?php
echo $html->link($html->image('logo.png', array(
				'alt'=> __('cBBweb', true),
				'border' => '0',
				'align' => 'middle')), array('controller' => 'pages', 'action' => 'display', 'home'),
array('escape' => false));
?></h1>
<form id="SelectChampionship" method="post" action="">
<fieldset style="display: none;"><input type="hidden" name="_method"
	value="POST" /></fieldset>
<fieldset><select name="data[AppController][Championship]"
	disable="disable" onchange="this.form.submit();"
	id="select_championship">
	<option value="">Select a Championship</option>
	<?php
	foreach ($championships_list as $key => $value) {
		if ($current_championship == $key) {
			$selected = 'selected';
		} else {
			$selected = '';
		}
		echo '<option ' . $selected . ' value="' . $key . '" >' . $value . '</option>';
	}
	?>
</select></fieldset>
</form>
<form id="SelectCoach" method="post" action="">
<fieldset style="display: none;"><input type="hidden" name="_method"
	value="POST" /></fieldset>
<fieldset><select name="data[AppController][Coach]"
	disable="disable" onchange="this.form.submit();"
	id="select_coach">
	<option value="">Select a Coach</option>
	<?php
	foreach ($coaches_list as $key => $value) {
		if ($current_coach == $key) {
			$selected = 'selected';
		} else {
			$selected = '';
		}
		echo '<option ' . $selected . ' value="' . $key . '" >' . $value . '</option>';
	}
	?>
</select></fieldset>
</form>
</div>
<div id="content">
<div class="menu">
<ul>
	<li><?php
	if (isset ($user)) {
		$tmp = $user;
	} else {
		$tmp = 'User';
	}
	echo $html->link($tmp, array (
					'controller' => 'users',
					'action' => 'index'
					));
					?>
	<ul>
		<li><?php
		if (isset ($user)) {
			echo $html->link(__('Logout', true), array (
						'controller' => 'users',
						'action' => 'logout'
						));
		} else {
			echo $html->link(__('Login', true), array (
						'controller' => 'users',
						'action' => 'login'
						));
		}
		?></li>
	</ul>
	</li>
	<li><?php
	echo $html->link(__('Coaches', true), array ('controller' => 'coaches','action' => 'index'));
	?></li>
	<li><?php
	echo $html->link(__('Teams', true), array ('controller' => 'teams','action' => 'index'));
	?>
	<ul>
		<li><?php
		echo $html->link(__('Statistics', true), array ('controller' => 'statistics_teams','action' => 'index'));
		?></li>
		<li><?php
		echo $html->link(__('Season Statistics', true), array ('controller' => 'statistics_season_teams','action' => 'index'));
		?></li>
		<li><?php
		echo $html->link(__('Hall of Fame', true), array ('controller' => 'statistics_teams','action' => 'get_bestteams'));
		?></li>
		<li><?php
		echo $html->link(__('Hall of Fame (Season)', true), array ('controller' => 'statistics_season_teams','action' => 'get_bestteams'));
		?></li>
	</ul>
	</li>
	<li><?php
	echo $html->link(__('Players', true), array ('controller' => 'players','action' => 'index'));
	?>
	<ul>
		<li><?php
		echo $html->link(__('Statistics', true), array ('controller' => 'statistics_players','action' => 'index'));
		?></li>
		<li><?php
		echo $html->link(__('Season Statistics', true), array ('controller' => 'statistics_season_players','action' => 'index'));
		?></li>
		<li><?php
		echo $html->link(__('Hall of Fame', true), array ('controller' => 'statistics_players','action' => 'get_bestplayers'));
		?></li>
		<li><?php
		echo $html->link(__('Hall of Fame (Season)', true), array ('controller' => 'statistics_season_players','action' => 'get_bestplayers'));
		?></li>
	</ul>
	</li>
	<li><?php
	echo $html->link(__('Championships', true), array ('controller' => 'championships','action' => 'index'));
	?>
	<ul>
		<li><?php
		echo $html->link(__('New', true), array ('controller' => 'championships','action' => 'add'));
		?></li>
		<li><?php
		echo $html->link(__('Update', true), array ('controller' => 'championships','action' => 'update'));
		?></li>
		<li><?php
		echo $html->link(__('New Season', true), array ('controller' => 'championships','action' => 'new_season'));
		?></li>
		<li><?php
		echo $html->link(__('Calendars', true), array ('controller' => 'calendars','action' => 'index'));
		?></li>
		<li><?php
		echo $html->link(__('Ranking', true), array ('controller' => 'team_rankings','action' => 'index'));
		?></li>
		<li><?php
		echo $html->link(__('Import Match Report', true), array ('controller' => 'calendars','action' => 'upload'));
		?></li>
	</ul>
	</li>
	<li><a href="" target="_self">Admin</a>
	<ul>
		<li><?php
		echo $html->link(__('Users', true), array ('controller' => 'users','action' => 'index'));
		?></li>
		<li><?php
		echo $html->link(__('Groups', true), array ('controller' => 'groups','action' => 'index'));
		?></li>
	</ul>
	</li>
</ul>
</div>
		<?php
		echo $this->Session->flash();
		echo $this->Session->flash('error');
		echo $content_for_layout;
		?></div>
<div id="footer">Copyright (C) 2010 <a
	href="http://code.google.com/p/cbbweb/">cBBweb</a>. Powered by <?php
	echo $html->link(
	$html->image('cake.power.gif', array(
				'alt'=> __('CakePHP: the rapid development php framework', true),
				'border' => '0')),
			'http://www.cakephp.org/',
	array('target' => '_blank', 'escape' => false)
	);
	?></div>
</div>
	<?php echo $this->element('sql_dump'); ?>
</body>
</html>
